package ch.elektroplan.cmueller.logikModulGenerator.business.elements;

public class Input {

	private static int TYPE = 5002;
	private int number;
	private String initialisationValue = ""+0;
	private int dataformat = 0;
	private String comment;
	private String name = "Eingang";

	public Input(int number) {

		this.number = number;
	}

	public void setInitialisationValue(String initialisationValue) {
		if (initialisationValue != null) {
			this.initialisationValue = initialisationValue;

		} else {
			this.initialisationValue = "" + 0;
		}
	}

	public void setDataformat(int dataformat) {
		if (dataformat == 0 || dataformat == 1) {
			this.dataformat = dataformat;
		} else {
			dataformat = 1;
		}
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public void setName(String name) {
		this.name = number + name;
	}

	public String getName() {
		return name;
	}

	public String getinputstring() {

		String output = TYPE + "|" + number + "|" + initialisationValue + "|"
				+ dataformat;

		return output;

	}

	public String getinputComment() {
		return "#" + this.comment;

	}

}
